Fix measuring passes in AdornerLayer of the underlying Adorner elements#10657
Open
h3xds1nz wants to merge 1 commit intodotnet:mainfrom
Open
Fix measuring passes in AdornerLayer of the underlying Adorner elements#10657h3xds1nz wants to merge 1 commit intodotnet:mainfrom
h3xds1nz wants to merge 1 commit intodotnet:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #10657 +/- ##
===================================================
+ Coverage 11.22814% 11.39704% +0.16890%
===================================================
Files 3352 3353 +1
Lines 668000 668068 +68
Branches 74980 74981 +1
===================================================
+ Hits 75004 76140 +1136
+ Misses 591745 590585 -1160
- Partials 1251 1343 +92
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
miloush
approved these changes
Mar 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10640
Description
Marks
AdornerLayerdirty when any of theAdornersis dirty and forces a measure pass so that the position is updated.Due to the aggressive performance optimization to only re-render when size/position changes (including transforms),
a case such as this has been overlooked so the position of the respective Adorner's is wrong while all flags are correct.
This could have been workarounded via synchronous
UpdateLayoutpass called by the user or invoking visual re-invalidation but due to its asynchronous nature this would only work the second time around.I have also removed the redundant assigment of cached
RenderSize/Transformand in-lined the two calls instead.This shall not add any unnecessary overhead according to my testing.
Customer Impact
If the fix is not taken, customers will continue to observe unwanted behaviour and will be required to use computionally expensive and synchronous updates to receive the correct position for Adorners upon adorned
UIElementchanges.Regression
Not according to my tests, this seems to be present both on
.NET CoreandNETFX.Testing
Local build, repro tests from #10640, tests with adorners.
Risk
Medium, it would be beneficial to test more real-life examples of adorners.
Microsoft Reviewers: Open in CodeFlow